<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<body>

<script src="/js/jquery.min.js"></script>


<h2>Hello World!   [[@{/}]]</h2>
<h2  th:text="'我是服务器 '+ ${#request.localPort} + '你好'" />
<h2  th:text="'当前sessionId '+ ${#session.id} " />

<!--<h2>我是服务器：${pageContext.request.localPort}</h2>-->
<!--<h2>当前sessionId：${pageContext.session.id}</h2>-->
<label>username</label><input id="username" type="text"><br>
<label>password</label><input id="password" type="text"><br>
<button id="loginIn">login in</button>


</body>
</html>

<script src="http://www.wodexiangce.cn/js/jquery-1.11.3.min.js" type="text/javascript"></script>


<script type="text/javascript">


    $("#loginIn").click(function(){

        var username = $("#username").val();
        var password = $("#password").val();
        // alert($("#username").val());
        // alert($("#password").val());



        if (username=="admin"&&password=="admin" ) {
            // 保存数据到sessionStorage
            sessionStorage.setItem('username', 'admin');
            sessionStorage.setItem('password', 'admin');

            $.ajax({

                type: 'POST',
                url: '[[@{/}]]resume/addSession',
                // data:JSON.stringify(data),
                contentType:'application/json',
                dataType:"json",
                async: false

            });

            // location.href="resumeList";
            location.href="[[@{/}]]resume/resumeList";

            // window.location.href = 'http://localhost:8080/resume/ResumeList';
        }else{
            alert("用户名或密码输入错误，请重试！")
        }

    });




</script>